package org.example.session;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class Resources {

    private static ClassLoaderWrapper classLoaderWrapper = new ClassLoaderWrapper();
    public Resources() {
    }


    public static InputStream getResourceAsStream(String resource) throws IOException {
        for (ClassLoader classLoader : classLoaderWrapper.getClassLoaders()) {
            if(classLoader == null)continue;
            InputStream resourceAsStream = classLoader.getResourceAsStream(resource);
            if(resourceAsStream != null)return resourceAsStream;
        }
        return null;
    }
}
